H=5;//current+H
ws=3;
gm=.9;
ngen=10;
ggsize=zeros(ngen+1,1);
ggrid=cell();
gepls=cell();
gpact=cell();
for k=0:ngen
    [fdg, err] = mopen("gen"+string(k)+".dat");
    //[fdp, err] = mopen("path"+string(k)+".dat");
    ggsize(k+1)=strtod(mgetl(fdg,1));
    ggrid(k+1).entries=mgetl(fdg);
    mclose(fdg);
    //expert=strtod(mgetl(fdp));
    //mclose(fdp);
    //for i=2:size(expert,1)
    //    gepls(k+1).entries(i-1)=expert(i)-expert(i-1);
    //end
//use part to search character
//define feature vectors for a state
//gen random weights
//find optimal strategy for weights ->write RL code add to policy list
//maximize weights for diff V
    //file("close", fdg);
    //file("close", fdp);
    gsize=ggsize(k+1);
    grid=ggrid(k+1).entries;
    pact=zeros(gsize,3,3);
    pact(:,1,1)=.8*ones(pact(:,1,1));
    pact(:,1,2)=.1*ones(pact(:,1,1));
    pact(:,1,3)=.1*ones(pact(:,1,1));
    pact(:,2,1)=.1*ones(pact(:,1,1));
    pact(:,2,2)=.8*ones(pact(:,1,1));
    pact(:,2,3)=.1*ones(pact(:,1,1));
    pact(:,3,1)=.1*ones(pact(:,1,1));
    pact(:,1,2)=.1*ones(pact(:,1,1));
    pact(:,3,3)=.8*ones(pact(:,1,1));
    pact(1,2,1)=0;
    pact(1,2,2)=.9;
    pact(1,3,1)=0;
    pact(1,3,2)=.2;
    pact(gsize,1,3)=0;
    pact(gsize,2,3)=0;
    pact(gsize,1,2)=.2;
    pact(gsize,2,2)=.9;
    gpact(k+1).entries=pact;
    gepls(k+1).entries=genpls2([1000;1;1000],1);
end
